#!/usr/bin/bash
echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin@localhost', '1qaz@WSX')" | /usr/bin/python /webvirtmgr-4.8.9/manage.py shell
/usr/bin/python /webvirtmgr-4.8.9/manage.py run_gunicorn --bind 0.0.0.0:8000 --log-file /webvirtmgr-4.8.9/webvirtmgr.log --daemon
if [ $? -eq 0 ];then
  nohup /usr/bin/python /webvirtmgr-4.8.9/console/webvirtmgr-console &> /dev/null &
  sleep 3
  tail -f /webvirtmgr-4.8.9/webvirtmgr.log
fi
